<template>
  <div>
     <van-cell :to="'/article/'+item.art_id">
       <template #title>
         <div class="van-multi-ellipsis--l2">
           {{item.title}}
         </div>
       </template>
       <template #label>
         <div class="img-box" v-if="item.cover.type > 1">
           <van-image
           v-for="(item,index) in item.cover.images"
           :key="index"
           class="right-img"
           fit="cover"
           :src="item"
         />
         </div>
         <div class="label-box">
           <span>{{item.aut_name}}</span>
           <span>{{item.pubdate | formatDate}}</span>
           <span>评论: {{item.comm_count}}</span>
         </div>
       </template>
       <!-- 默认插槽为右边内容 -->
       <template>
         <van-image
           class="right-img"
           v-if="item.cover.type === 1"
           fit="contain"
           :src="item.cover.images[0]"
         />
       </template>
     </van-cell>
  </div>
</template>

<script>
export default {
  props: {
    item: {
      type: Object,
      required: true
    }
  }
}
</script>

<style scoped lang='less'>
.label-box {
  span:nth-child(2){
    margin: 0 10px;
  }
}
.van-cell__value {
  flex:unset
}
.van-cell__value,.right-img {
  width: 232px;
  height: 146px;
}
.img-box {
  display: flex
}
 .van-image {
    width: 232px;
    height: 146px;
  }
  .van-image:nth-child(2) {
    margin: 0 4px;
  }
</style>
